package com.zhang.init;

import com.zhang.application.StaffingApplication;
import com.zhang.pojo.Department;
import com.zhang.service.DepartmentService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author ZhangJunqi
 * @Date 2022/3/2 -22:31
 */
@Component
public class StaffingInit {
    @Resource
    private DepartmentService departmentService;
    public void departmentInit(){
        List<Department> departmentList=departmentService.getAllDepartment();
        if(departmentList!=null&& departmentList.size ()>0){
            System.out.println("初始化部门信息");
            StaffingApplication.departmentList=departmentList;
        }
    }
}
